package com.imooc.imoocbilibili.controller;

import com.imooc.imoocbilibili.annotation.ApiLimitRole;
import com.imooc.imoocbilibili.constants.AuthRoleConstant;
import com.imooc.imoocbilibili.service.AuthRoleService;
import com.imooc.imoocbilibili.utils.R;
import com.imooc.imoocbilibili.vo.UserAuthVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 权限控制--角色表
 *
 * @author jl
 * @since 2022-04-10 21:13:43
 */
@RestController
@RequiredArgsConstructor
public class AuthRoleController {

    private final AuthRoleService authRoleService;

    /**
     * 查询菜单权限
     */
    @ApiLimitRole(limitedRoleCodeList = {AuthRoleConstant.ROLE_LV0})
    @GetMapping("/user-authorities")
    public R getUserAuthorities() {
        return R.ok(authRoleService.getUserAuthorities());
    }

}
